$OpenBSD: patch-Makefile_in,v 1.1.1.1 2016/01/01 11:54:26 bentley Exp $
--- Makefile.in.orig	Sun Dec 20 00:56:37 2015
+++ Makefile.in	Sun Dec 20 00:56:54 2015
@@ -552,11 +552,12 @@ modes: modes.xml
 
 install-data-local:
 	apertium-gen-modes modes.xml apertium-$(PREFIX1)
-	$(INSTALL_DATA) $(PREFIX1).mode $(apertium_eo_esmodesdir)
-	$(INSTALL_DATA) $(PREFIX2).mode $(apertium_eo_esmodesdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t1x $(BASENAME).$(PREFIX1).t2x $(apertium_eo_esdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t3x $(BASENAME).$(PREFIX1).t1x.translit $(apertium_eo_esdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t2x.translit $(BASENAME).$(PREFIX1).t3x.translit $(apertium_eo_esdir)
+	test -d $(DESTDIR)$(apertium_eo_esmodesdir) || mkdir $(DESTDIR)$(apertium_eo_esmodesdir)
+	$(INSTALL_DATA) $(PREFIX1).mode $(DESTDIR)$(apertium_eo_esmodesdir)
+	$(INSTALL_DATA) $(PREFIX2).mode $(DESTDIR)$(apertium_eo_esmodesdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t1x $(BASENAME).$(PREFIX1).t2x $(DESTDIR)$(apertium_eo_esdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t3x $(BASENAME).$(PREFIX1).t1x.translit $(DESTDIR)$(apertium_eo_esdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t2x.translit $(BASENAME).$(PREFIX1).t3x.translit $(DESTDIR)$(apertium_eo_esdir)
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
